/* 
 * File:   Gravity.cpp
 * Author: RedEyedKiller
 * 
 * Created on 1 Μάρτιος 2011, 3:12 πμ
 */

#include "Gravity.h"
#include "PhysicalObject.h"

namespace physicsSystem
{
namespace forces
{

Gravity::Gravity(const Math::Vector2F& gravity_) : gravity(gravity_)
{

}

Gravity::Gravity(float magnitude, int direction) : gravity(magnitude, direction, false)
{

}

void Gravity::Prepare(float seconds)
{
    //currentGravity = gravity * seconds;
}

void Gravity::Affect(PhysicalObject* object)
{
    if (!object->HasInfiniteMass())
    {
        object->SetGeneralAcceleration(gravity * object->GetMass());
    }
}

}
}